package com.smart.dao;
 
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.smart.model.Info;
import com.smart.model.InfoCond;

/**
 * 
 * @author Sunxin
 *
 */
 
@Repository
public class InfoDaoImpl extends BaseEntityDao<Info, InfoCond, Long> implements InfoDao{

	@Override
	public void updateViewCount(Long id) {
		String hql = "update Info info set info.viewCount = info.viewCount + 1 where id = :id";
		Query query = super.getSession().createQuery(hql);
		query.setParameter("id", id);
		query.executeUpdate();
	}
}
